/**
 * PlayerCardController steuert die Anweisungen des Benutzers auf dem CardPanel
 *
 * @author Michael Hansen
 * @author Lukas Thuernagel
 * @author Soeren Warszus
 */

package risk.game;

import java.awt.event.*;
import risk.player.PlayerModel;
import java.util.*;
import javax.swing.*;
import java.awt.*;
import java.awt.image.*;

public class PlayerCardController implements ActionListener,MouseListener
{
    /**
     * Das zugehoerige Model
     */
    private PlayerCard pc;
    
    /**
     * Das zugehoerige PlayerCardView
     */
    private PlayerCardView pcv;
    
    public PlayerCardController(PlayerCard pc, PlayerCardView pcv)
    {
        this.pc = pc;
        this.pcv = pcv;
     
    }
    
    /**
     * Prueft, ob die Maus auf einen Button klickt und ruft die
     * entsprechenden Methoden auf.
     *
     * @param MouseEvent e Das zu uebergebende Event
     */    
    public void mouseClicked  (MouseEvent e) { }
    public void mouseReleased (MouseEvent e) { }
    public void mousePressed  (MouseEvent e) { }
    public void mouseEntered  (MouseEvent e) { }
    public void mouseExited   (MouseEvent e) { }
    public void mouseMoved    (MouseEvent e) { }
    public void mouseDragged  (MouseEvent e) { }
    public void actionPerformed(ActionEvent e) {
        if ("change".equals(e.getActionCommand())){
            pc.getPlayerModel().setUnitCount(pc.getPlayerModel().getUnitCount()+pcv.getCardBonus());
            pc.getPlayerModel().getBoardView().updateView();
            this.pcv.initializeView();
        }
    
    }

}